package com.example.springbootfenye.controller;

import com.example.springbootfenye.entity.UserEntity;
import com.example.springbootfenye.req.UserReq;
import com.example.springbootfenye.resp.CommonResp;
import com.example.springbootfenye.resp.PageResp;
import com.example.springbootfenye.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userservice;

    @GetMapping("/getList")
    public CommonResp getList(UserReq userreq){
        CommonResp<PageResp<UserEntity>> resp = new CommonResp<>();
        PageResp<UserEntity> list = userservice.getList(userreq);
        resp.setContent(list);
        return resp;
    }
}
